using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using DATA.BusinessObjects;
using DATA.Base;

namespace DATA.ManagerObjects
{
    public partial interface IHoadonManager : IManagerBase<DATA.BusinessObjects.Hoadon, string>
    {
		// Get Methods
		IList<Hoadon> GetByMaKhachHang(System.String khachhang);
    }

    partial class HoadonManager : ManagerBase<DATA.BusinessObjects.Hoadon, string>, IHoadonManager
    {
		#region Constructors
		
		public HoadonManager() : base()
        {
        }
        public HoadonManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Hoadon> GetByMaKhachHang(System.String khachhang)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Hoadon));
			
			
			ICriteria khachhangCriteria = criteria.CreateCriteria("Khachhang");
            khachhangCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", khachhang));
			
			return criteria.List<Hoadon>();
        }
		
		#endregion
    }
}